Skip to content

Match the class the standalone Battle.net install produces - #10567

Closed
pmbemax wants to merge 1 commit into
omacom:quattrofrom
pmbemax:fix-battlenet-window-class
Closed

pmbemax wants to merge 1 commit into
omacom:quattrofrom
pmbemax:fix-battlenet-window-class

Conversation

@pmbemax

@pmbemax pmbemax commented Sep 7, 2026

Copy link
Copy Markdown

What happened

default/hypr/apps/battlenet.lua matches class = "^steam_app_battlenet$", but Battle.net installed with omarchy install gaming battlenet produces battle.net.exe (launcher) and battle.net-setup.exe (installer). Omarchy's own default/applications/battlenet.desktop already records the right value — StartupWMClass=battle.net.exe — so the two shipped files disagree and none of these rules ever apply to Omarchy's own installer.

Measured on a fresh standalone install (Omarchy 4.0.2, Hyprland 0.56.2):

$ hyprctl clients -j | jq -r '.[] | select(.class|test("battle";"i")) | "class=\(.class) | title=\(.title) | float=\(.floating)"'
class=battle.net-setup.exe | title=Battle.net Setup | float=false
class=battle.net.exe       | title=Battle.net Login | float=false
class=battle.net.exe       | title=Battle.net       | float=false
class=battle.net.exe       | title=Select Folder    | float=false

Expected: the launcher floats centered at 1280x800 and the installer loses its decorations, blur and shadow. Actual: the launcher tiles into the current workspace, the Blizzard installer is framed by the WM, and the folder picker used by Locate this game tiles at column width, which is where it is genuinely unusable.

[INFERENCE] the steam_app_battlenet string looks like it predates the move to umu-launcher, or was written against a Steam-hosted install.

Also removed: title predicates that cannot match

A window rule is applied when the window is mapped, and the launcher maps with the title Battle.net Login, only becoming Battle.net after sign-in — so title = "^Battle\\.net$" could not fire even with the class corrected. Matching on class alone is sufficient here, because in the standalone prefix the launcher owns that class by itself (games get their own, e.g. wow.exe), and it means the launcher's own dialogs — the folder picker, update prompts — float with it instead of tiling.

Steps to reproduce

  1. omarchy install gaming battlenet on a machine with no previous Battle.net.
  2. Click through the Blizzard installer, sign in.
  3. hyprctl clients -j | jq -r '.[] | select(.class|test("battle";"i")) | .class'
  4. Observe battle.net.exe / battle.net-setup.exe, and that the launcher is tiled.

Tests

test/shell.d/battlenet-test.sh gains a check that the rules match whatever StartupWMClass the desktop entry declares, and that the Steam-hosted class is gone, so the two files cannot drift apart again. Red before the change:

not ok - battlenet.lua matches the class battlenet.desktop declares (battle.net.exe)

Green after. ./test/all: test/shell reports three failures on this checkout — launch-about-test.sh, plymouth-set-test.sh, snapper-test.sh — and all three fail identically on clean main here (they need a root-authorized checkout, an omarchy-pkgs checkout, and a live compositor respectively). No other suite regressed.

System

Omarchy 4.0.2-1, Hyprland 0.56.2, Arch, AMD RX 7900 XTX, 3 monitors. Battle.net installed via omarchy install gaming battlenet (umu-launcher + GE-Proton), prefix ~/Games/battlenet.

battlenet.lua keyed every rule on steam_app_battlenet, a class only a
Steam-hosted install would carry. omarchy-install-gaming-battlenet installs
Battle.net standalone under umu-launcher, where the launcher's class is
battle.net.exe and the installer's is battle.net-setup.exe -- which
default/applications/battlenet.desktop already records as
StartupWMClass=battle.net.exe. The two files disagreed, so none of these
rules applied to Omarchy's own installer: the launcher tiled into the
current workspace and the Blizzard installer kept its decorations, blur and
shadow.

Drop the title predicates with the class fix. A window rule is applied when
the window is mapped, and the launcher maps as "Battle.net Login", only
becoming "Battle.net" after sign-in, so a title-matched rule could not fire
either. Under the standalone install the launcher owns its class by itself --
games get their own (wow.exe and friends) -- so there is nothing left to
disambiguate by title, and the launcher's own dialogs (the folder picker in
"Locate this game", update prompts) inherit the float instead of tiling.

The test asserts the rules match whatever StartupWMClass the desktop entry
declares, so the two cannot drift apart again.
@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for the detailed write-up. I ran this on a disposable Omarchy VM (Hyprland 0.56.2, umu-launcher 1.4.4 from the Arch repos, GE-Proton11-7 as umu downloads it). On that stock setup, Battle.net reports the class steam_app_battlenet, the one quattro already matches, so I can't merge this as it stands.

What I checked

  • I ran the real Battle.net-Setup.exe with the installer's exact environment (WINEPREFIX=~/Games/battlenet PROTONPATH=GE-Proton GAMEID=umu-battlenet PROTON_VERB=run umu-run …). It opened an XWayland window with class=steam_app_battlenet, title=Battle.net Setup. The Wine processes had SteamGameId=battlenet. That comes from umu: umu_run.py matches GAMEID against ^umu-[\d\w]+$, strips the umu- prefix into SteamAppId, and copies it to SteamGameId. Proton then names X11 windows steam_app_<SteamGameId>.
  • I checked the rules themselves by opening test windows with the classes battle.net.exe and battle.net-setup.exe. On quattro neither rule fires. On this head both do: the launcher floats at 1280x800, and the installer floats with decorate=false. The new rules work for those classes, but a stock install doesn't produce them.
  • With this branch's rules loaded, the real setup window was framed by the WM. On quattro, its Battle.net Setup rule would have removed that frame.
  • test/shell.d/battlenet-test.sh passes on the worker at this head.

What this would change on a stock install

  • Neither Battle.net rule would match any more, so the installer would get its decorations, blur and shadow back.
  • The added test passes vacuously. grep -F "battle.net.exe" matches the new comments on lines 2 and 4 of default/hypr/apps/battlenet.lua, not the rule, which uses escaped dots. The steam_app_battlenet check also forbids the class the stock install actually produces.
  • Games launched from Battle.net inherit the same environment, so on a stock install they share steam_app_battlenet. That is why quattro keys on the title as well as the class. A class-only rule on that shared class would float and resize every game window to 1280x800.

What may still be real

Your point that the launcher maps as Battle.net Login and only later becomes Battle.net is plausible. If so, the float, centre and size rules never apply to it, because they are only evaluated when a window maps. I couldn't confirm it here: the setup exits after the language screen on a VM with no GPU, so the launcher never appeared. If that's what you see, the proportionate fix keeps the class and widens the title, e.g. title = "^Battle\\.net( Login)?$".

What would help

Your measurement differs from this one, so something in your environment differs from stock. With Battle.net running, could you post the output of the following?

pacman -Q umu-launcher
ls ~/.local/share/Steam/compatibilitytools.d/
hyprctl clients -j | jq -r '.[] | select(.class|test("battle";"i")) | "\(.class) xwayland=\(.xwayland)"'
tr '\0' '\n' < /proc/$(pgrep -f 'Battle.net.exe' | head -1)/environ | grep -E '^(SteamGameId|SteamAppId|PROTON_ENABLE_WAYLAND|PROTON_USE_WAYLAND)='

xwayland=false would mean Wine's Wayland driver is in use, and it names windows differently. If that is a configuration Omarchy should support, the rules can match both classes while keeping the title guards.

Codex Medium gave a second opinion, with my reproduction evidence as part of its brief. It agreed with the conclusion, and independence is not guaranteed. It contributed the vacuous-test finding and the point about game windows sharing the class. This is waiting on you, the author.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants